package com.ruoyi.ai.controller;

import com.ruoyi.ai.api.bo.WxChatMessageBo;
import com.ruoyi.ai.service.IWxChatService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/ai/webChat")
public class WebChatController extends BaseController {
    private final IWxChatService iWxChatService;
    /**
     * 网页聊天
     */
    @PostMapping("/chat")
    public R<Void> chat(@RequestBody WxChatMessageBo chatMessageBo) {
        iWxChatService.chat(chatMessageBo);
        return R.ok();
    }
}
